<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改图书信息')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-bookinfo-edit" th:object="${dgBookInfo}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">图书名称：</label>
                <div class="col-sm-8">
                    <input name="bookName" th:field="*{bookName}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">作者id：</label>
                <div class="col-sm-8">
                    <input name="authorId" th:field="*{authorId}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">出版社id：</label>
                <div class="col-sm-8">
                    <input name="publishId" th:field="*{publishId}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">图书简介：</label>
                <div class="col-sm-8">
                    <textarea name="descption" class="form-control" required>[[*{descption}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">价格：</label>
                <div class="col-sm-8">
                    <input name="price" th:field="*{price}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">图片路径：</label>
                <div class="col-sm-8">
                    <input name="imagePath" th:field="*{imagePath}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">分类目录id：</label>
                <div class="col-sm-8">
                    <input name="indexId" th:field="*{indexId}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">折扣价：</label>
                <div class="col-sm-8">
                    <input name="discountPrice" th:field="*{discountPrice}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否作者亲签版：</label>
                <div class="col-sm-8">
                    <select name="isSign" class="form-control m-b" th:with="type=${@dict.getType('dg_true_or_false')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isSign}"></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "gzbook/bookinfo";
        $("#form-bookinfo-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-bookinfo-edit').serialize());
            }
        }
    </script>
</body>
</html>